package integer;

//Integer.valueof()
public class Demo02 {
    public static void main(String[] args) {
        //已过时
        /*Integer i1 = new Integer(100);
        System.out.println(i1);

        //Integer i2 = new Integer("abc");
        Integer i2 = new Integer("100");
        System.out.println(i2);*/
        //现在
        Integer i1 = Integer.valueOf(100);
        Integer i3 = 200;
        System.out.println(i1);
        System.out.println(i3);
        Integer i2 = Integer.valueOf("100");
        //Integer i4 = "100";

        System.out.println(i2);

        //如果是字符串,同样会出错哦
        //Integer i3 = Integer.valueOf("abc");
        //System.out.println(i3);


    }
}
